﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class Ball : MonoBehaviour
{
    public Rigidbody2D rb;
    public SpriteRenderer sp;

    public ColorType colorType;

    public float speed;
    void Start()
    {
        ShuaiFunction.Refresh(sp, colorType);
    }


    void Update()
    {
        Vector2 direction = (Player.Instance.transform.position - transform.position).normalized;
        rb.velocity = direction * speed;

        //rb.velocity = new Vector2(-10, 0);
    }
}
